package com.sz.app.customer.common;

import com.sz.common.base.logger.Logger;
import com.sz.common.core.service.PrincipalUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.springframework.util.ObjectUtils;

/**
 * Function: 获取当前账户下的详细信息 <br>
 * Author: Charles <br>
 * Date: 2016-11-03 17:43:00
 */
public class CustomerPrincipalUtils extends PrincipalUtils {
    private static Logger logger = Logger.getLogger(CustomerPrincipalUtils.class);

    public static int getUserType() {
        int userType = 0;
        Session session = SecurityUtils.getSubject().getSession();
        Object obj = session.getAttribute("userType");
        if (!ObjectUtils.isEmpty(obj)) {
            userType = (int) obj;
        }
        return userType;
    }

}
